/**
 * Created by WJQ on 2018/3/29 15:07.
 */
const path = require ('path');
const UglifyJSPlugin = require ('uglifyjs-webpack-plugin');

module.exports = {
    entry: "./src/main.js",
    output: {
        path: path.resolve (__dirname, '../dist'),
        filename: "[name].js"
    },
    devtool: "source-map",//开启资源地图模式, 方便寻找错误",
    module: {
        rules: [
            {
                test: /\.js$/,
                loader: 'babel-loader'
            },
            {
                test: /\.css$/,
                loader: 'style-loader!css-loader'
            },
        ]
    },
    plugins: [
        new UglifyJSPlugin ({
            test: /\.js$/,
            sourceMap: true,
            parallel: true
        })
    ]
}
